/*
 * w25q64.h
 *
 *  Created on: 2024年10月30日
 *      Author: zizhong
 */

#ifndef USER_INC_W25Q64_H_
#define USER_INC_W25Q64_H_

#include "board.h"
#include "spi.h"

#define SPI_FLASH_PageSize              256
#define SPI_FLASH_PerWritePageSize      256

#define W25X_WriteEnable        0x06
#define W25X_WriteDisable       0x04
#define W25X_ReadStatusReg      0x05
#define W25X_WriteStatusReg     0x01
#define W25X_ReadData           0x03
#define W25X_FastReadData       0x0B
#define W25X_FastReadDual       0x3B
#define W25X_PageProgram        0x02
#define W25X_BlockErase         0xD8
#define W25X_SectorErase        0x20
#define W25X_ChipErase          0xC7
#define W25X_PowerDown          0xB9
#define W25X_ReleasePowerDown   0xAB
#define W25X_DeviceID           0xAB
#define W25X_ManufactDeviceID   0x90

#define WIP_Flag                0x01  /* Write In Progress (WIP) flag */
#define Dummy_Byte              0x00

void W25Q_Write_CMD(uint16_t Cmd,uint32_t Addr);
uint16_t W25Q_ReadID(void);



#endif /* USER_INC_W25Q64_H_ */
